<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app"></div>

  <template id="my-app">
    <button v-on:click="btn1Click">按钮1</button>
    <div style="width: 100px; height:100px; background-color: red;" v-on:mousemove="mouseMove">按钮2</div>
    <!-- 语法糖 -->
    <button @click="btn1Click">按钮1</button>
    <div style="width: 100px; height:100px; background-color: blue;" @mousemove="mouseMove">按钮2</div>
    <!-- 联合绑定 -->
    <div style="width: 100px; height:100px; background-color: yellow;" v-on="{click: btn1Click, mousemove: mouseMove}"></div>
    <!-- 联合绑定 语法糖 -->
    <div style="width: 100px; height:100px; background-color: purple;" @="{click: btn1Click, mousemove: mouseMove}"></div>
  </template>
  <script src="../js/vue.js"></script>
  <script>
    const App = {
      template: '#my-app',
      data() {
        return {
          message: 'halo'
        }
      },
      methods: {
        btn1Click() {
          console.log('点击一次按钮1')
        },
        mouseMove() {
          console.log("鼠标移动")
        }
      }
    }
    Vue.createApp(App).mount('#app')
  </script>
</body>
</html>